From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar@free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi@qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj@www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi@qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi@qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi@qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle@cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx@mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx@mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:22:00 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:01 2006 Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:22:01 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:01 2006 Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:22:01 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar@free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi@qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj@www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi@qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi@qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi@qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0001.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle@cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx@mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx@mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 18:25:24 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0001.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0001.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:25 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar@free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi@qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj@www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi@qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi@qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi@qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0002.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle@cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx@mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx@mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0002.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0002.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:20 2006 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0003.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0003.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0003.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0001.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0004.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0004.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0004.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0002.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0005.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0005.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0005.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0003.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0006.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0006.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0006.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0004.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0007.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0007.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0007.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0005.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0008.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0008.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0008.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0006.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0009.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0009.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0009.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0007.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0010.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0010.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0010.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0008.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0011.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0011.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0011.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0009.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0012.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0012.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0012.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0010.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0013.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0013.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0013.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0011.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0014.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0014.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0014.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0012.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0015.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0015.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0015.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0013.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0016.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0016.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0016.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0014.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0017.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0017.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0017.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0015.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0018.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0018.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0018.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0016.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0019.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0019.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0019.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0017.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0020.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0020.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0020.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0018.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0021.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0021.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0021.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0019.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0022.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0022.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0022.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0020.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0023.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0023.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0023.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0021.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0024.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0024.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0024.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0022.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0025.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0025.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0025.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0023.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0026.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0026.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0026.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0024.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0027.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0027.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0027.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0025.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0028.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0028.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0028.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0026.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0029.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0029.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0029.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0027.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0030.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0030.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0030.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0028.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0031.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0031.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0031.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0029.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0032.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0032.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0032.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0030.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0033.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0033.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0033.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0031.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0034.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0034.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0034.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0032.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0035.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0035.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0035.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0033.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0036.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0036.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0036.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0034.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0037.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0037.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0037.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0035.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0038.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0038.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0038.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0036.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0039.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0039.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0039.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0037.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0040.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0040.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0040.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0038.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0041.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0041.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0041.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0039.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0042.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0042.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0042.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0040.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0043.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0043.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0043.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to